/*
 Navicat Premium Data Transfer

 Source Server         : dell
 Source Server Type    : MySQL
 Source Server Version : 80019
 Source Host           : localhost:3306
 Source Schema         : gulimall_wms

 Target Server Type    : MySQL
 Target Server Version : 80019
 File Encoding         : 65001

 Date: 16/05/2021 17:55:19
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for undo_log
-- ----------------------------
DROP TABLE IF EXISTS `undo_log`;
CREATE TABLE `undo_log` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `branch_id` bigint NOT NULL,
  `xid` varchar(100) NOT NULL,
  `context` varchar(128) NOT NULL,
  `rollback_info` longblob NOT NULL,
  `log_status` int NOT NULL,
  `log_created` datetime NOT NULL,
  `log_modified` datetime NOT NULL,
  `ext` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ux_undo_log` (`xid`,`branch_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of undo_log
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for wms_purchase
-- ----------------------------
DROP TABLE IF EXISTS `wms_purchase`;
CREATE TABLE `wms_purchase` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `assignee_id` bigint DEFAULT NULL COMMENT '采购单id',
  `assignee_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '采购单名字',
  `phone` char(13) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '电话号码',
  `priority` int DEFAULT NULL COMMENT '优先级',
  `status` int DEFAULT NULL COMMENT '采购单状态[0新建，1已分配，2正在采购，3已完成，4采购失败]',
  `ware_id` bigint DEFAULT NULL COMMENT '仓库id',
  `amount` decimal(18,4) DEFAULT NULL COMMENT '采购数量',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1311623203860262915 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='采购信息';

-- ----------------------------
-- Records of wms_purchase
-- ----------------------------
BEGIN;
INSERT INTO `wms_purchase` VALUES (1311620578364481537, 1, '罗俊华', '123', 232, 3, 1311228083319119873, 220.0000, '2020-10-01 18:54:49', '2020-10-01 18:56:07');
INSERT INTO `wms_purchase` VALUES (1311621291236777985, 2, '高孔燕', '1231', 12, 4, 2, 12312312.0000, '2020-10-01 18:57:39', '2020-10-01 18:59:05');
INSERT INTO `wms_purchase` VALUES (1311623203860262914, 3, '燕燕', '185', 123, 4, 1, 23.0000, '2020-10-01 19:05:15', '2020-10-01 19:06:20');
COMMIT;

-- ----------------------------
-- Table structure for wms_purchase_detail
-- ----------------------------
DROP TABLE IF EXISTS `wms_purchase_detail`;
CREATE TABLE `wms_purchase_detail` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `purchase_id` bigint DEFAULT NULL COMMENT '采购单id',
  `sku_id` bigint DEFAULT NULL COMMENT '采购商品id',
  `sku_num` int DEFAULT NULL COMMENT '采购数量',
  `sku_price` decimal(18,4) DEFAULT NULL COMMENT '采购金额',
  `ware_id` bigint DEFAULT NULL COMMENT '仓库id',
  `status` int DEFAULT NULL COMMENT '状态[0新建，1已分配，2正在采购，3已完成，4采购失败]',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1311623162760278018 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of wms_purchase_detail
-- ----------------------------
BEGIN;
INSERT INTO `wms_purchase_detail` VALUES (1311620432817938433, 1311620578364481537, 7, 20, 1000.0000, 1311228083319119873, 3);
INSERT INTO `wms_purchase_detail` VALUES (1311620542918418434, 1311620578364481537, 2, 200, 1212.0000, 1311228083319119873, 3);
INSERT INTO `wms_purchase_detail` VALUES (1311621113389899777, 1311621291236777985, 3, 100, 12120021.0000, 2, 3);
INSERT INTO `wms_purchase_detail` VALUES (1311621243916640257, 1311621291236777985, 10, 200, 1213123.0000, 2, 2);
INSERT INTO `wms_purchase_detail` VALUES (1311623063791480833, 1311623203860262914, 15, 100, 1099920.0000, 1, 3);
INSERT INTO `wms_purchase_detail` VALUES (1311623162760278017, 1311623203860262914, 14, 200, 2131342.0000, 1, 4);
COMMIT;

-- ----------------------------
-- Table structure for wms_ware_info
-- ----------------------------
DROP TABLE IF EXISTS `wms_ware_info`;
CREATE TABLE `wms_ware_info` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
  `name` varchar(255) DEFAULT NULL COMMENT '仓库名',
  `address` varchar(255) DEFAULT NULL COMMENT '仓库地址',
  `areacode` varchar(20) DEFAULT NULL COMMENT '区域编码',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1311228083319119874 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='仓库信息';

-- ----------------------------
-- Records of wms_ware_info
-- ----------------------------
BEGIN;
INSERT INTO `wms_ware_info` VALUES (1, '昆明仓库', '昆明市', '650000');
INSERT INTO `wms_ware_info` VALUES (2, '上海仓库', '上海', '998000');
INSERT INTO `wms_ware_info` VALUES (1311228083319119873, '成都1号仓库', '四川成都', '100000');
COMMIT;

-- ----------------------------
-- Table structure for wms_ware_order_task
-- ----------------------------
DROP TABLE IF EXISTS `wms_ware_order_task`;
CREATE TABLE `wms_ware_order_task` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
  `order_id` bigint DEFAULT NULL COMMENT 'order_id',
  `order_sn` varchar(255) DEFAULT NULL COMMENT 'order_sn',
  `consignee` varchar(100) DEFAULT NULL COMMENT '收货人',
  `consignee_tel` char(15) DEFAULT NULL COMMENT '收货人电话',
  `delivery_address` varchar(500) DEFAULT NULL COMMENT '配送地址',
  `order_comment` varchar(200) DEFAULT NULL COMMENT '订单备注',
  `payment_way` tinyint(1) DEFAULT NULL COMMENT '付款方式【 1:在线付款 2:货到付款】',
  `task_status` tinyint DEFAULT NULL COMMENT '任务状态',
  `order_body` varchar(255) DEFAULT NULL COMMENT '订单描述',
  `tracking_no` char(30) DEFAULT NULL COMMENT '物流单号',
  `create_time` datetime DEFAULT NULL COMMENT 'create_time',
  `ware_id` bigint DEFAULT NULL COMMENT '仓库id',
  `task_comment` varchar(500) DEFAULT NULL COMMENT '工作单备注',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1336457631023308803 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='库存工作单';

-- ----------------------------
-- Records of wms_ware_order_task
-- ----------------------------
BEGIN;
INSERT INTO `wms_ware_order_task` VALUES (1335557979847606274, 1, '202012062013211491335557940542795778', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-12-06 20:13:31', NULL, NULL);
INSERT INTO `wms_ware_order_task` VALUES (1336307045124624386, 2, '202012082149591111336307034705973250', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-12-08 21:50:02', NULL, NULL);
INSERT INTO `wms_ware_order_task` VALUES (1336457631023308802, 3, '1336457629488168961', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-12-09 07:48:24', NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for wms_ware_order_task_detail
-- ----------------------------
DROP TABLE IF EXISTS `wms_ware_order_task_detail`;
CREATE TABLE `wms_ware_order_task_detail` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
  `sku_id` bigint DEFAULT NULL COMMENT 'sku_id',
  `sku_name` varchar(255) DEFAULT NULL COMMENT 'sku_name',
  `sku_num` int DEFAULT NULL COMMENT '购买个数',
  `task_id` bigint DEFAULT NULL COMMENT '工作单id',
  `ware_id` bigint DEFAULT NULL COMMENT '仓库id',
  `lock_status` int DEFAULT NULL COMMENT '1-已锁定  2-已解锁  3-扣减',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1336457631212052482 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='库存工作单';

-- ----------------------------
-- Records of wms_ware_order_task_detail
-- ----------------------------
BEGIN;
INSERT INTO `wms_ware_order_task_detail` VALUES (1335557979885355010, 2, NULL, 1, 1335557979847606274, 1, 2);
INSERT INTO `wms_ware_order_task_detail` VALUES (1336307046294835202, 7, NULL, 3, 1336307045124624386, 1, 2);
INSERT INTO `wms_ware_order_task_detail` VALUES (1336457631212052481, 7, ' 华为 HUAWEI P40 Pro | 亮黑色 | 8G+128G', 1, 1336457631023308802, 1, 1);
COMMIT;

-- ----------------------------
-- Table structure for wms_ware_sku
-- ----------------------------
DROP TABLE IF EXISTS `wms_ware_sku`;
CREATE TABLE `wms_ware_sku` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
  `sku_id` bigint DEFAULT NULL COMMENT 'sku_id',
  `ware_id` bigint DEFAULT NULL COMMENT '仓库id',
  `stock` int DEFAULT NULL COMMENT '库存数',
  `sku_name` varchar(200) DEFAULT NULL COMMENT 'sku_name',
  `stock_locked` int DEFAULT '0' COMMENT '锁定库存',
  PRIMARY KEY (`id`),
  KEY `sku_id` (`sku_id`) USING BTREE,
  KEY `ware_id` (`ware_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1335550281819176962 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='商品库存';

-- ----------------------------
-- Records of wms_ware_sku
-- ----------------------------
BEGIN;
INSERT INTO `wms_ware_sku` VALUES (1311621652349575169, 13, 2, 66, 'iphone11手机 | 白色 | 8G+128G', 0);
INSERT INTO `wms_ware_sku` VALUES (1334385420045197313, 10, 1, 100, ' 华为 HUAWEI P40 Pro | 零度白 | 8G+128G', 0);
INSERT INTO `wms_ware_sku` VALUES (1334393627660591106, 7, 1, 100, ' 华为 HUAWEI P40 Pro | 亮黑色 | 8G+128G', 1);
INSERT INTO `wms_ware_sku` VALUES (1335550281819176961, 2, 1, 1000, 'iphone11手机 | 亮黑色 | 8G+256G', 0);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
